/*
 * Copyright (c) 2008-2021 浩瀚深度 All Rights Reserved.
 *
 * <p>FileName: ZmqController.java</p>
 *
 * @author zz
 * @date 2024/3/26
 * @version 1.0
 * History:
 * v1.0.0 2024/3/26 Create
 */
package com.monitor.controller;

import com.monitor.base.Result;
import com.monitor.base.ResultCode;
import com.monitor.entity.ZmqMsg;
import com.monitor.service.ZmqService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>Title: ZmqController</p>
 * <p>Description: </p>
 *
 * @author zz
 */
@Slf4j
@RestController
@RequestMapping("/zmq")
@CrossOrigin(origins = "*")
public class ZmqController {

    @Autowired
    ZmqService zmqService;

    @PostMapping("/send")
    public Result send(@RequestBody ZmqMsg msg) {
        String result = zmqService.sendZmqMsg(msg);
        // 返回统一的结果
        return new Result(ResultCode.SUCCESS, result);
    }
}
